AWS ParallelCluster 3のクラスター作成にはNode.jsのインストールが必要になりました

AWS ParallelCluster 3のクラスター作成にはNode.jsのインストールが必要になりました

Clock Icon2021.09.11

この記事は公開されてから1年以上経過しています。情報が古い可能性がありますので、ご注意ください。

AWS ParallelCluster v3.0.0がリリースされました。アップデート紹介は検証後、別の機会に。

Release AWS ParallelCluster v3.0.0 · aws/aws-parallelcluster

pclusterコマンドのアップグレードか、新規インストールすればAWS ParallelCluster 3.0.0を試せるかと思ったらそうはいきませんでした。以下のエラーメッセージが表示されたときの対応方法を紹介します。

"message": "Unable to find node executable. Node.js is required by the AWS CDK library used by ParallelCluster, see installation instructions here: https://docs.aws.amazon.com/parallelcluster/latest/ug/install-v3.html"

ParallelClusterのバージョン

ParallelCluster 3.0.0でも引き続きvenvでの仮想環境の管理が推奨されています。

以下のリンクの手順で管理コマンド(pcluster)を準備します。

pclusterコマンドの準備は簡単です。出力結果がJSON形式に変更されました。

> pcluster version
{
  "version": "3.0.0"
}

クラスターを作成してみる

3.0.0からはpclusterコマンドのクラスター作成のオプションや、書式が変更されています。クラスター作成にはpcluster create-clusterを使用します。

> pcluster create-cluster --cluster-name sample-cluster --region ap-northeast-1 --cluster-configuration first-config.yml

Node.jsのAWS CDKを利用してParallelClusterを構築するように変更されていました。以前はCloudFormationから直接作成していたのですが、CDKの利用に置き換わっています。というわけで、Node.jsをインストールするのが必須になりました。

{
  "message": "Unable to find node executable. Node.js is required by the AWS CDK library used by ParallelCluster, see installation instructions here: https://docs.aws.amazon.com/parallelcluster/latest/ug/install-v3.html"
}

Node.jsのインストール

pclusterの準備の後に必要となる手順のドキュメントは以下のリンクでした。

Steps to take after installation - AWS ParallelCluster

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
~/.nvm/nvm.sh
nvm install node
node --version
v16.9.1

改めてクラスター作成

pclusterコマンドの準備に加えて、Node.jsをインストール済みの環境でクラスターを作成します。クラスター名はsample-clusterとしています。

> pcluster create-cluster --cluster-name sample-cluster --region ap-northeast-1 --cluster-configuration first-config.yml

ParallelCluster 2以前はクラスター完成までプロンプトが返ってきませんでした。ParallelCluster 3からプロンプトは返ってきて、クラスターの作成処理は非同期になっています。それはそれでありがたいのですが構築が順調に進んでいるのか、よくあるコンフィグミスで失敗したのかわかりません。

{
  "cluster": {
    "clusterName": "sample-cluster",
    "cloudformationStackStatus": "CREATE_IN_PROGRESS",
    "cloudformationStackArn": "arn:aws:cloudformation:ap-northeast-1:12345679012:stack/sample-cluster/eec2fac0-1297-11ec-b7b7-0afe01580399",
    "region": "ap-northeast-1",
    "version": "3.0.0",
    "clusterStatus": "CREATE_IN_PROGRESS"
  }
}

クラスターの作成状況確認

クラスター名を指定してpcluster describe-clusterコマンドで確認する必要があります。sample-clusterの状態を確認します。

> pcluster describe-cluster --region ap-northeast-1 --cluster-name sample-cluster

CREATE_COMPLETEを確認できたのでクラスター構築できたことがわりました。

{
  "creationTime": "2021-09-11T00:42:17.686Z",
  "headNode": {
    "launchTime": "2021-09-11T00:45:40.000Z",
    "instanceId": "i-0edbab7e92874f029",
    "publicIpAddress": "35.76.171.169",
    "instanceType": "t3a.micro",
    "state": "running",
    "privateIpAddress": "10.0.1.158"
  },
  "version": "3.0.0",
  "clusterConfiguration": {
    "url": "https://parallelcluster-50bb4ae12fec178e-v1-do-not-delete.s3.ap-northeast-1.amazonaws.com/parallelcluster/3.0.0/clusters/sample-cluster-6vib105oqxwfleod/configs/cluster-config.yaml
  },
  "tags": [
    {
      "value": "3.0.0",
      "key": "parallelcluster:version"
    }
  ],
  "cloudFormationStackStatus": "CREATE_COMPLETE",
  "clusterName": "sample-cluster",
  "computeFleetStatus": "RUNNING",
  "cloudformationStackArn": "arn:aws:cloudformation:ap-northeast-1:12345679012:stack/sample-cluster/1d6e8000-1299-11ec-88d3-0acfd0f918f7",
  "lastUpdatedTime": "2021-09-11T00:42:17.686Z",
  "region": "ap-northeast-1",
  "clusterStatus": "CREATE_COMPLETE"
}

マネージメントコンソールから確認

pcluster describe-clusterコマンドの引数が多くて手間でした。CloudFormationの画面から確認してみます。クラスター名(sample-cluster)と同名のスタックが作成されています。

EC2インスタンスを確認するとヘッドノードが起動しています。

おわりに

メジャーアップデートだけあって変更が大きいです。影響の大きいところでは設定ファイルの書式が刷新されています。過去の資産はいきないため、少しづつ検証してご紹介していきたいと思います。

この記事をシェアする

facebook logohatena logotwitter logo

© Classmethod, Inc. All rights reserved.